home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 4 / The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO / clang / cenvid.zip / CENVI.DOC < prev    next >
Text File  |  1993-08-10  |  38KB  |  732 lines

  1.                     CEnvi Shareware Manual, Chapter 1:
  2.                        CEnvi Unregistered Shareware
  3.  
  4.  
  5.                       CEnvi unregistered version 1.0
  6.                                9 AUGUST 1993
  7.  
  8.                        CEnvi Shareware User's Manual
  9.  
  10.           Copyright 1993, Nombas, All Rights Reserved.
  11.           Published by Nombas, P.O. Box 875, Medford, MA 02155 USA
  12.           (617)391-6595, (617)391-5289
  13.  
  14.           Thank you for trying this shareware version of CEnvi from Nombas.
  15.  
  16. 1.  CEnvi Unregistered Shareware
  17.  
  18. 1.1.  Introduction to Cmm and CEnvi
  19.  
  20.           Cmm (C minus minus) is 'C' for the rest of us.  CEnvi runs Cmm
  21.           programs in the DOS, Windows, OS/2, NT, Unix, etc...
  22.           environments.  Together, CEnvi and Cmm make the power and
  23.           flexibility of the C programming language part of every computer
  24.           user's environment, without the hardware, time, and programmer
  25.           resources needed for developing full-blown C programs.
  26.  
  27.           With CEnvi and Cmm, anyone can take control of their computer
  28.           environment.  C is not just for programming nerds anymore.  CEnvi
  29.           utilites, macros, batch files, and scripts can quickly be
  30.           created, shared, and modified among all computer users,
  31.           professional and amateur alike.
  32.  
  33.           CEnvi can be incorporated at a pace that is comfortable to you:
  34.           you may just want to use CEnvi code set up by a more experienced
  35.           user, you may want to enhance existing batch files with a line or
  36.           two of CEnvi code, or you may write complete utilities using
  37.           CEnvi.
  38.  
  39. 1.2.  CEnvi unregistered shareware version
  40.  
  41.           This package is the unregistered shareware version of CEnvi.
  42.           Nombas provides this unregistered shareware version of CEnvi so
  43.           that you can try the program for a while before deciding whether
  44.           to buy.  If, after a few weeks of using using this product, you
  45.           think CEnvi will be useful to you and/or your organization then
  46.           use the registration form at the end of this document (or see the
  47.           file: REGISTER.DOC) to register CEnvi.
  48.  
  49. 1.2.1   Why you should register
  50.  
  51.           If you register, then you will receive:
  52.             *The latest version of CEnvi for all supported platforms
  53.               (currently DOS, OS/2, and Windows, with NT support expected
  54.               soon) without the annoying "Please Register" reminder.
  55.             *The CEnvi user's manual (almost 100 pages, including a
  56.               description of the Cmm programming language, a tutorial for
  57.               those who have never programmed, and descriptions and
  58.               examples of the nearly 150 functions included in the CEnvi
  59.               library).
  60.             *Free incremental electronic downloads for new versions of
  61.               CEnvi for all supported operating systems.
  62.             *Unlimited support from Nombas and CEnvi/Cmm users through
  63.               CompuServe (72212,1622), internet (bsn@world.std.com), the
  64.               cenvi-cmm e-mail mailing list (cenvi-cmm@world.std.com), and
  65.               the Nombas BBS (617-391-6595).
  66.             *Access to the growing list of CEnvi utilities and libraries
  67.               (some of which are included in this unregistered shareware
  68.               package, and others are contributed by Nombas and CEnvi/Cmm
  69.               users to the electronic locations described above).
  70.             *Discounts for additional registered version of CEnvi to use
  71.               within your organization.
  72.  
  73. 1.2.2   How to register
  74.  
  75.           See the REGISTER.DOC document that is included with this package
  76.           (and is also duplicated at the end of this document), to purchase
  77.           a registered version of CEnvi.
  78.  
  79. 1.3.  Installing CEnvi, documents, and sample files
  80.  
  81.           To install this package for evaluation
  82.             * Create a directory and then copy all of these files into that
  83.               directory.
  84.             * From within that directory execute CEnvi.exe.
  85.             * At the CEnvi "Code:" prompt enter "Install.cmm" to execute
  86.               the Install program (which is written in Cmm).
  87.             * You may then test CEnvi by trying out the included example
  88.               files and by creating CEnvi code of your own.
  89.  
  90.           For DOS and OS/2 versions, the install.cmm program will set up
  91.           the PATH environment variable to include the directory you
  92.           installed the files in, and will also set the CMMPATH environment
  93.           variable to this directory.  For Windows, install will add the
  94.           CMMPATH profile value in WIN.INI (in the [CEnvi] section), and
  95.           will also add the CMM file extension to the [Extensions] section
  96.           in WIN.INI.
  97.  
  98. 1.4.  Removing CEnvi unregistered shareware
  99.  
  100.           If, after testing CEnvi for a few weeks, you choose not to
  101.           register this version of CEnvi, then you should remove the
  102.           program from your computer.  (Also please consider telling Nombas
  103.           why CEnvi did not suit your needs; we need such feedback if we
  104.           are to improve the product.)
  105.  
  106.           For all operating systems, the first step for removing CEnvi is
  107.           to delete all the CEnvi files and the directory that you copied
  108.           the files to.  The next step depends on your operating system:
  109.  
  110. 1.4.1   DOS de-installation
  111.  
  112.           Install.cmm made two changes to C:\AUTOEXEC.BAT: the directory
  113.           that CEnvi was in will have been added to your PATH statement,
  114.           and the CMMPATH environment variable will have been added.  To
  115.           de-install CEnvi you must remove the CEnvi directory from the
  116.           PATH statement and you must also delete the "SET CMMPATH=..."
  117.           line.
  118.  
  119. 1.4.2   OS/2 de-installation
  120.  
  121.           Install.cmm made two changes to C:\CONFIG.SYS: the directory that
  122.           CEnvi was in will have been added to your PATH statement, and the
  123.           CMMPATH environment variable will have been added.  To de-install
  124.           CEnvi you must remove the CEnvi directory from the PATH statement
  125.           and you must also delete the "SET CMMPATH=..." line.
  126.  
  127. 1.4.3   Windows de-installation
  128.  
  129.           Install.cmm made two changes to WIN.INI: the CMM profile
  130.           extension was added and the CMMPATH profile string was created.
  131.           To de-install CEnvi you must edit WIN.INI (with NOTEPAD.EXE for
  132.           example) and remove from the [Extensions] section a line similar
  133.           to this:
  134.                CMM=C:\CENVI\CENVI.EXE ^.CMM
  135.           and also remove these line (or lines much like these) from
  136.           WIN.INI:
  137.                [CEnvi]
  138.                CMMPATH=E:\NOMBAS\CENVI\EXAMPLES.WIN
  139.  
  140. 1.5.  Using this package
  141.  
  142. 1.5.1   Unregistered CEnvi shareware executable
  143.  
  144.           The executable in this package, named CEnvi.EXE, is identical to
  145.           the registered version of CEnvi at the time this package was
  146.           created with one exception: this unregistered shareware version
  147.           will occasionally put up a screen to remind you to register your
  148.           copy of CEnvi (see the bottom of this document or REGISTER.DOC).
  149.           Nombas has spent, and will continue to spend, time and resources
  150.           developing and supporting CEnvi and Cmm.  Without your honest
  151.           support Nombas cannot improve and support CEnvi (and pay
  152.           mortgage, feed the kids, pay the doctor, etc...).
  153.  
  154.           It is likely that months have elapsed since this shareware
  155.           package has been put together (see date at the top of this file).
  156.           If so, then the version of CEnvi you receive will be an updated
  157.           version of this one.  At the time of this release, incremental
  158.           improvements have been planned in memory use, speed of execution,
  159.           debugging tools, developer tools, and documentation.
  160.  
  161. 1.5.2   Example programs
  162.  
  163.           The following example programs are included with this shareware
  164.           version of CEnvi.  Those files with a batch extension (.BAT for
  165.           DOS and .CMD for OS/2) can be run by invoking the batch file
  166.           directly.  Those files with the CEnvi source file extension
  167.           (.CMM) are invoked by executing CEnvi with the file name as the
  168.           first argument (e.g. CENVI FranTick.cmm).  Files with different
  169.           (e.g., *.LIB, *.H, *.DAT) are files used by CEnvi some of the
  170.           example programs.
  171.  
  172.           Many of the files will provide help for how to use them if they
  173.           are invoked with "/?" as the only parameter.
  174.  
  175.           All of these example files are here for you to view, study,
  176.           experiment with, and alter for your own use.  The Nombas BBS will
  177.           continue to gather CEnvi and Cmm example files created by Nombas
  178.           or uploaded by CEnvi and Cmm users; so registered users will have
  179.           a large library to choose from (maybe some other CEnvi user has
  180.           already solved your need, or perhaps their need is close to yours
  181.           and you will only have to make small modifications to someone
  182.           else's uploaded CEnvi program). 
  183.  
  184. 1.5.3   DOS example files:
  185.             *AllDirs.bat: Perform a command in this directory and all
  186.               sub-directories
  187.             *AllFiles.bat: Perform a command on all files matching a given
  188.               file specification
  189.             *Ascii.bat: Display the ascii character table
  190.             *BatLoops.bat: Examples of various methods CEnvi can use to
  191.               allow looping within batch files
  192.             *BattMem.bat: Show values stored in a PC's battery-protected
  193.               memory
  194.             *Border.cmm: Draw a simple border on the screen
  195.             *DelTree.bat: Delete a directory tree
  196.             *DelTree1.bat: Delete a directory tree - another method
  197.             *DelTree2.bat: Delete a directory tree - yet another method
  198.             *DirStat.bat: Extract specific fields from a DOS "DIR" listing
  199.             *DiskFree.bat: Display free space on a disk drive
  200.             *DosTime.bat: Show time according to computer's internal clock
  201.             *Fibonacc.cmm: Two methods for generating the Fibonacci
  202.               sequence
  203.             *FileFind.bat: Wildcard search for files on current drive or on
  204.               all drives
  205.             *Find#.cmm: Extract a number from wordy output; used by
  206.               DirStat.bat
  207.             *FranTick.cmm: Animated tick who drank too much coffee
  208.             *GetUKey.cmm: Display a choice prompt and then set an
  209.               environment variable based on user's selection 
  210.             *Hello.cmm: My first Cmm program. Used to begin the Cmm
  211.               tutorial.
  212.             *HexDump.bat: Display hexidecimal dump of a file
  213.             *Install.cmm: Install this CEnvi unregistered shareware
  214.               version.
  215.             *IsDay_1.bat: One method to check if it is a specific day of
  216.               the week
  217.             *IsDay_2.bat: Another method to check if it's a specific day of
  218.               the week
  219.             *IsItFri.bat: Is it Friday?
  220.             *KbdBuf.bat: Alter the size of the keyboard buffer
  221.             *KbdRate.bat: Alter the typematic rate of the keyboard
  222.             *KeyCode.bat: Display keycode of any key pressed
  223.             *KeyState.bat: Get or set the state of the NumLock or CapsLock
  224.               keys
  225.             *KeyStuff.bat: Stuff characters into the keyboard buffer
  226.             *MemBlock.bat: Trace through DOS's allocated memory blocks
  227.             *Mouse.bat: Demonstrate reading a mouse's position and state
  228.             *MultiDir.bat: DOS's "DIR" command allowing multiple file
  229.               specifications
  230.             *NumLockd.bat: Set the NumLock key on
  231.             *OneADay.bat: Perform any command(s) no more than once per day
  232.             *PathAdd.bat: Add a directory to your PATH environment
  233.               variable.
  234.             *PathDel.bat: Remove a directory from your PATH environment
  235.               variable
  236.             *PathStak.bat: Multi-level save or restore of current drive and
  237.               directory so that you can change drives and directories and
  238.               still return to this one
  239.             *PathSubs.bat: Use DOS's SUBST command to shorten your PATH
  240.               environment variable so that more paths can be fit with DOS'
  241.               127-byte limit
  242.             *Primes.bat: Demonstrate automatic array allocation for
  243.               calcualting prime numbers
  244.             *PrmptDay.bat: Change command-line-prompt to display today's
  245.               date
  246.             *Quote.bat: Choose a "profound" quote at random
  247.             *REBOOT_1.BAT: One method to reboot your computer
  248.             *REBOOT_2.BAT: Another method to rebott your computer
  249.             *Restrict.cmm: Allow a limited subset of DOS commands
  250.             *SortLen.bat: Sort any file based on line length
  251.             *Sound.bat: Play a frequency for a given time period
  252.             *Tee.cmm: Save screen output to a file while it is being
  253.               displayed on the screen
  254.             *ValidDir.bat: Verify if a directory is valid
  255.             *Wait.bat: Puse and do not return for specifiec number of
  256.               seconds
  257.  
  258. 1.5.4   OS/2 example files:
  259.             *AllDirs.cmd: Perform a command in this directory and all
  260.               sub-directories
  261.             *AllFiles.cmd: Perform a command on all files matching a given
  262.               file specification
  263.             *Ascii.cmd: Display the ascii character table
  264.             *BatLoops.cmd: Examples of various methods CEnvi can use to
  265.               allow looping within batch files
  266.             *Border.cmm: Draw a simple border on the screen
  267.             *CEnviSet.cmd: This file can be used instead of CEnvi.exe if
  268.               you are using environment variables as Cmm variables and need
  269.               them to be changed in the current OS/2 environment.
  270.             *DelTree.cmd: Delete a directory tree
  271.             *DelTree1.cmd: Delete a directory tree - another method
  272.             *DelTree2.cmd: Delete a directory tree - yet another method
  273.             *Devices.cmd: Show status of system devices.
  274.             *DirStat.cmd: Extract specific fields from a DOS "DIR" listing
  275.             *DiskFree.cmd: Display free space on a disk driveDirStat.cmd:
  276.             *DosCalls.lib: Example library of "wrapper" function calls to
  277.               OS/2 API calls in the DosCalls library.  This file is
  278.               "#include"ed in many of the other example files.
  279.             *EPM.cmd: Wrapper for EPM.EXE for C programmers which will
  280.               bring in realted *.c, *.H and *.asm files
  281.             *Fibonacc.cmm: Two methods for generating the Fibonacci
  282.               sequence
  283.             *FileFind.cmd: Wildcard search for files on current drive or on
  284.               all drives
  285.             *Find#.cmm: Extract a number from wordy output; used by
  286.               DirStat.bat
  287.             *FranTick.cmm: Animated tick who drank too much coffee
  288.             *GetUKey.cmm: Display a choice prompt and then set an
  289.               environment variable based on user's selection 
  290.             *Hello.cmm: My first Cmm program. Used to begin the Cmm
  291.               tutorial.
  292.             *HexDump.cmd: Display hexidecimal dump of a file
  293.             *IDLE.cmd: Change process priority to run a CEnvi program only
  294.               during system idle time.
  295.             *Install.cmm: Install this CEnvi unregistered shareware
  296.               version.
  297.             *IsDay_1.cmd: One method to check if it is a specific day of
  298.               the week
  299.             *IsDay_2.cmd: Another method to check if it's a specific day of
  300.               the week
  301.             *IsItFri.cmd: Is it Friday?
  302.             *KbdRate.cmd: Alter the typematic rate of the keyboard
  303.             *KeyCode.cmd: Display keycode of any key pressed
  304.             *KeyState.cmd: Get or set the state of the NumLock or CapsLock
  305.               keys
  306.             *KillProc.cmd: Terminate a running process by Process ID, full
  307.               name, or partial name
  308.             *MultiDir.cmd: OS/2's "DIR" command allowing multiple file
  309.               specifications
  310.             *OneADay.cmd: Perform any command(s) no more than once per day
  311.             *OS2Time.cmd: Show time according to computer's internal clock
  312.             *Parents.cmd: Show heriarchical list of ancestor's process ID's
  313.               and names
  314.             *PathAdd.cmd: Add a directory to your PATH environment
  315.               variable.
  316.             *PathDel.cmd: Remove a directory from your PATH environment
  317.               variable
  318.             *PathStak.cmd: Multi-level save or restore of current drive and
  319.               directory so that you can change drives and directories and
  320.               still return to this one
  321.             *PMdll.lib: Example library of "wrapper" routines to function
  322.               in the PM DLL (Presentatiom Manager Dynamic Link Library).
  323.               This file is "#include"ed in many of the other example files.
  324.             *Primes.cmd: Demonstrate automatic array allocation for
  325.               calcualting prime numbers
  326.             *PrmptDay.cmd: Change command-line-prompt to display today's
  327.               date
  328.             *ProcList.cmd: Show list of all running processes; their names
  329.               and ID's
  330.             *Quote.cmd: Choose a "profound" quote at random
  331.             *Restrict.cmm: Allow a limited subset of DOS commands
  332.             *Setup.cmd: Open the OS/2 Setup Setup folder on the desktop
  333.             *SortLen.cmd: Sort any file based on line length
  334.             *Sound.cmd: Play a frequency for a given time period
  335.             *Switch.cmd: Switch foreground application to another process
  336.               base on process ID, full name, or partial name
  337.             *Tee.cmm: Save screen output to a file while it is being
  338.               displayed on the screen
  339.             *Threads.cmd: Display list of all threads in all running
  340.               processes
  341.             *ValidDir.cmd: Verify if a directory is valid
  342.             *Wait.cmd: Puse and do not return for specifiec number of
  343.               seconds
  344.             *Windows.cmd: Start up full-screen windows session with
  345.               specified Windows program.  This file contains specific DOS
  346.               notebook settings that should be altered to meet your
  347.               computer's configuration.
  348.             *WinList.cmd: Display list of all PM windows
  349.             *WPFolder.cmd: Open a desktop folder for any specified
  350.               directory and optionally switch to that window
  351.  
  352. 1.5.5   Windows example files:
  353.  
  354.           The following CEnvi source programs can be run by associating the
  355.           .cmm file extension with CEnvi.exe.  This can be done by using
  356.           the File Manager: select one of these .cmm files then choose
  357.           File/Association and select the full path to CEnvi.exe.  After
  358.           this, you can run any of these exmple files simply by
  359.           double-clicking on it.
  360.             *Ascii.cmm: Display the ascii character table
  361.             *BattMem.cmm: Show values stored in a PC's battery-protected
  362.               memory
  363.             *BootEd1.cmm: Startup NotePad to edit c:\AutoExec.bat and
  364.               C:\Config.sys using Windows DLL's.
  365.             *BootEd2.cmm: Startup NotePad to edit c:\AutoExec.bat and
  366.               C:\Config.sys using CEnvi's spawn() function.
  367.             *Border.cmm: Draw a simple border on the screen
  368.             *DosTime.cmm: Show time according to computer's internal clock
  369.             *Fibonacc.cmm: Two methods for generating the Fibonacci
  370.               sequence
  371.             *FranTick.cmm: Animated tick who drank too much coffee
  372.             *Hello.cmm: My first Cmm program. Used to begin the Cmm
  373.               tutorial.
  374.             *HexDump.cmd: Display hexidecimal dump of a file
  375.             *Icons.cmm: Minimize all windows.  Demonstrate PostMessage()
  376.               from Message.lib.
  377.             *Install.cmm: Install this CEnvi unregistered shareware
  378.               version.
  379.             *Message.lib: Wrappter for Windows' PostMessage() and
  380.               SendMessage() fucntion to send commands to windows.
  381.             *MsgBox.lib: A wrapper library for Windows' MessageBox()
  382.               function.  This file is #include'd in other CEnvi sample
  383.               files.
  384.             *MsgBoxes.cmm: Show various message box types using the
  385.               function in MsgBox.lib.
  386.             *OpenCmm.cmm: Use Windows' common dialog (via PickFile.lib) to
  387.               select a *.cmm file to edit.
  388.             *PickFile.lib: A simple interface to the GetOpenFileName()
  389.               function in the Windows Common Dialog DLL.  This library file
  390.               is #include'd in some of the other CEnvi sample files.
  391.             *Quote.cmm: Choose a "profound" quote at random
  392.             *WinBeep.cmm: Call Windows' MessageBeep() function.
  393.             *WinExec.lib: A wrapper library for Windows' WinExec()
  394.               function.  This file is #include'd in other CEnvi sample
  395.               files.
  396.             *WinExecs.cmm: Demonstratio of Windows' WinExec() function
  397.               using the wrapper from WinExec.lib.
  398.             *WinList.cmm: Show a list of all Windows, their handles, and
  399.               their children.
  400.             *WinUtil.lib: A small selection of utilities that may be
  401.               #include'd in CEnvi code to get simple access to Windows DLL
  402.               functions.
  403.  
  404. 1.6.  CEnvi - A Cmm Interpreter
  405.  
  406.           This section describes the CEnvi program, and describes the
  407.           various methods for use CEnvi.exe to execute Cmm programs.
  408.  
  409. 1.6.1   What is CEnvi?
  410.  
  411.           CEnvi is the first (and so far only) application to implement the
  412.           Cmm programming language.  CEnvi is a Command-line version of a
  413.           Cmm interpreter, and it can use Environment variables as if they
  414.           were global Cmm variables.  CEnvi contains a reasonable facsimile
  415.           of the standard C library, and can link at runtime to external
  416.           Cmm libraries.
  417.  
  418.           The "Envi" and the "C" in CEnvi reflects the envy that computer
  419.           professionals often feel when they are working on a computer that
  420.           does not have a complete C programming environment.  "Envi" also
  421.           refers to the environment variables that CEnvi attempts to work
  422.           with as if they were regular Cmm variables.
  423.  
  424.           Like all implementations for Cmm, CEnvi is portable between
  425.           operating systems.  It is currently testing under DOS, OS/2, and
  426.           Windows, and other OS ports are in the works.
  427.  
  428. 1.6.2   Environment Variables
  429.  
  430.           Variables in all UPPERCASE letters are taken from the environment
  431.           variables.  Environment variables are treated like other
  432.           variables except that they don't need quotes around them to
  433.           default to being strings if they don't match another type.
  434.  
  435.           To the source code, the only difference between a variable and an
  436.           environment variable is that environment variables are all
  437.           UPPER_CASE letters.  When the environment variable is first used
  438.           it is read from the environment block and some assumptions are
  439.           made about what kind of variable it is; this can lead to problems
  440.           when I=666 is interpreted as the number 666 when really it maybe
  441.           should have been the string "666".  Before the program exits, all
  442.           environment variables used by the code are then written to the
  443.           environment block.
  444.  
  445.           In some implementations (CEnvi for DOS, for example) the
  446.           environment variables remain changed even after the Cmm
  447.           interpreter exits.  In other cases, special kludges must be added
  448.           to alter a parent process' environment variables (see ESet() for
  449.           OS/2).
  450.  
  451. 1.6.3   Special Environment Variables
  452.  
  453.           These environment variables affect where CEnvi looks for source
  454.           files:
  455.             *CMMPATH: This environment will be checked for directories to
  456.               search for include files if the include file is not in the
  457.               current directory.  For Windows, this value may come from the
  458.               CMMPATH profile value in WIN.INI (in the [CEnvi] section).
  459.             *PATH: Batch-file source files (see below) will be searched in
  460.               these directories if not found in the current directory.
  461.             *CENVI_ESET: In those environment for which CEnvi cannot
  462.               covertly alter the environment variables of the command
  463.               interpreter (e.g., OS/2), this environment variable specifies
  464.               a file name.  CEnvi will write the strings necessary for the
  465.               command interpreter to set environment variables as altered
  466.               by your Cmm code.  See the description of ESet() for more
  467.               information about this command.
  468.  
  469. 1.6.4   Executing Code as command-line Input Parameters
  470.  
  471.           If a Cmm program is very short, then it can be executed wholly
  472.           from the command line.  For example, here is the famous hello
  473.           world program executed from the cli prompt:
  474.               CEnvi main() { printf("Hello world!"); }
  475.           which can be written more conisely under Cmm rules as:
  476.               CEnvi printf("Hello world!")
  477.  
  478.           You may have to keep in mind bahavior of the cli when inputting
  479.           code.  It is sometimes necessary to put quotes around code to
  480.           keep symbols from being interpreted by the cli, as in this
  481.           example:
  482.               CEnvi "for(i=0;i<10;i++) printf("%d\n",i)"
  483.           where the quotes are necessary to prevent the cli from
  484.           interpreting the "<" as file redirection.
  485.  
  486.           Also, in batch files (DOS, OS/2) you need to remember that "%"
  487.           has special meaning for the batch file processor, and so the
  488.           above line in a batch would have to be written as:
  489.               CEnvi "for(i=0;i<10;i++) printf("%%d\n",i)"
  490.  
  491. 1.6.5   Executing *.CMM Source File Code
  492.  
  493.           A file with the extension ".CMM", if the file name is given as
  494.           the first parameter to CEnvi.exe, is considered by CEnvi to be
  495.           pure CMM source code.  This file with the .CMM extension is
  496.           expected to be a plain Cmm source file, just as a C compiler
  497.           expects a file with the .C extension to be C source code.  CEnvi
  498.           will check the current directory for the .CMM file, and then
  499.           check directories in the PATH environment variable.  Any
  500.           arguments passed to CEnvi.exe after the .CMM source name are
  501.           given to the main(argc,argv) function in the source, if there is
  502.           one.  So the hellow.cmm program can look identical to the
  503.           hellow.c program, and when you run CEnvi.exe hellow.cmm you get
  504.           the same output.  If you run
  505.               CEnvi.exe FOO.CMM One Two Three
  506.           the main function in FOO.CMM would get argc=4 and
  507.           argv[0]="FOO.CMM" and argv[3]="THREE".
  508.  
  509.           This all means that if you were to have an executable FOO.EXE
  510.           that is similar to FOO.CMM, then "FOO.EXE" is interchangeable
  511.           with "CENVI FOO.CMM", i.e.,
  512.               FOO.EXE arg1 arg2 arg3
  513.           is the same as:
  514.               CENVI FOO.CMM arg1 arg2 arg3
  515.  
  516.           In OS/2 or windows or other environments where file extensions
  517.           can be associated with programs, you may want to associate the
  518.           .CMM extension with CEnvi.exe, so that double-clicking on
  519.           HELLOW.CMM will act identically to double-clicking on the
  520.           compiled-and-linked HELLOW.EXE.
  521.  
  522. 1.6.6   Batch-File Kludge
  523.  
  524.           The most convenient method for executing Cmm source code from the
  525.           DOS or OS/2 command line is sort of a kludge: if the first
  526.           argument to CEnvi is the name of a batch file, then CEnvi reads
  527.           that batch file and accepts as source all the code between the
  528.           lines "GOTO CENVI_EXIT" and ":CENVI_EXIT", and passes the command
  529.           line arguments to main(argc,argv).  This is very similar to
  530.           executing:
  531.               CEnvi.exe #include'foo,bat,,GOTO CENVI_EXIT,:CENVI_EXIT'
  532.           except that the '#include' statement is handled automatically by
  533.           CEnvi, and the rest of the command-line arguments are passed to
  534.           main().
  535.  
  536.           Note that ".bat" is the DOS version of the batch file name
  537.           extension.  This name is different for different operating
  538.           systems.
  539.  
  540.           In this way, a batch file can be run exactly like a .EXE file,
  541.           and the command arguments are passed to main in the same way.  If
  542.           the full path of the batch file is not supplied, then CENvi will
  543.           look in the current directory and then in directories in the
  544.           PATH.
  545.  
  546.           Here is an example of an OS/2 batch file that expects any number
  547.           (up to 9) of integers and sets the SUM environment variable to
  548.           the values added together.  (It calls CEnviSet instead of CEnvi
  549.           directly in order to set the environment variable.)
  550.  
  551.               @echo off
  552.               REM *********************************************************
  553.               REM *** SUM.BAT - Use CEnvi to sum lots of numbers together,*
  554.               REM ***           setting the SUM environment variable to   *
  555.               REM ***           the result of adding all the numbers.     *
  556.               REM *********************************************************
  557.               call CEnviSet %0.bat %1 %2 %3 %4 %5 %6 %7 %8 %9
  558.               GOTO CENVI_EXIT
  559.  
  560.               main(argc,argv)
  561.               {
  562.                 SUM = 0;
  563.                 for ( i = 1; i < argc; i++ )
  564.                 SUM += atoi(argv[i])
  565.               }
  566.  
  567.               :CENVI_EXIT
  568.  
  569. 1.6.7   EXTPROC: *.CMD Source file (For OS/2)
  570.  
  571.           Under the OS/2 command processor, you can define an external
  572.           processor to process a batch (*.cmd) file if the first statement
  573.           is EXTPROC.  EXTPROC is followed by the name of the processor,
  574.           which in this case will be "CEnvi".  This is an example file,
  575.           ARGS.CMD, of a program to display all input parameters:
  576.  
  577.               EXTPROC CEnvi
  578.  
  579.               main(argc,argv)
  580.               {
  581.                 for ( i = 0; i < argc; i++ )
  582.                 printf("Input argument %d = \%s\n",i,argv[i]);
  583.               }
  584.  
  585. 1.6.8   REXX-File Kludge (For OS/2)
  586.  
  587.           Similar to the Batch-File Kludge described above, if the first
  588.           argument to CEnvi is the name of a REXX source file then CEnvi
  589.           automatically executes the code between "SIGNAL CENVI_EXIT" and
  590.           "CENVI_EXIT:".  This example Rexx file for OS/2 behaves the same
  591.           as the previous batch program example (CEnviSet.cmd is an OS/2
  592.           batch file that helps run Cmm files if environment variables need
  593.           to be altered--see ESet in the OS2Lib appendix):
  594.  
  595.               /***********************************************************
  596.                *** SUM.CMD - Use CEnvi to sum lots of numbers together,***
  597.                ***           setting the SUM environment variable to   ***
  598.                ***           the result of adding all the numbers.     ***
  599.                ***********************************************************/
  600.               'call CEnviSet %0.cmd %1 %2 %3 %4 %5 %6 %7 %8 %9'
  601.               SIGNAL CENVI_EXIT
  602.  
  603.               main(argc,argv)
  604.               {
  605.                 SUM = 0;
  606.                 for ( i = 1; i < argc; i++ )
  607.                 SUM += atoi(argv[i])
  608.               }
  609.  
  610.               CENVI_EXIT:
  611.  
  612. 1.6.9   CMM File Association and Drag-and-Drop (OS/2)
  613.  
  614.           You can associate CEnvi.exe with .cmm files through the settings
  615.           notebook of CEnvi.exe.  This lets you executed any CEnvi *.cmm
  616.           file simply by double-clicking its icon in the desktop.
  617.  
  618.           A Cmm program can be set up as a Workplace Shell program that
  619.           accepts drag and drop.  To do this, drag a program template out
  620.           of the templates folder and place it on the desktop where you
  621.           want your Cmm program to run from.  In program settings for this
  622.           program object set the program name to the path and file
  623.           specification for CEnvi.exe (e.g., "C:\CMM\CEnvi.exe").  Set
  624.           Parameters to the full source and file name of the Cmm file
  625.           (e.g., "C:\CMM\CZIP.cmm").  Then rename the program object to
  626.           whatever you want (e.g., "CZIP").  Then whenever you drag a file
  627.           onto that object then the filename will be the second argument to
  628.           main().
  629.  
  630. 1.6.10  CMM File Association and Drag-and-Drop (Windows)
  631.  
  632.           You can associate Cmm files with CEnvi.exe by using the File
  633.           Manager: select a .cmm file then choose File/Association and
  634.           select the full path to CEnvi.exe.  After this, you can run any
  635.           of *.cmm program simply by double-clicking on it.
  636.  
  637. -------------------------------- FILE LIST --------------------------------
  638. The CEnvi Unregistered Shareware package includes the files in the
  639. following list.  You are not permitted to upload or otherwise transfer
  640. copies of any registered version of CEnvi that does not include all of the
  641. files in this list.
  642.  
  643. *CENVI.EXE: CEnvi shareware executable for DOS, OS/2, or Windows.
  644. *CENVI.DOC: CEnvi Shareware Manual, Chapter 1: CEnvi Unregistered Shareware
  645. *CMMTUTOR.DOC: CEnvi Shareware Manual, Chapter 2: Cmm Language Tutorial
  646. *CMM_VS_C.DOC: CEnvi Shareware Manual, Chapter 3: Cmm versus C, for C
  647.   Programmers
  648. *CENVILIB.DOC: CEnvi Shareware Manual, Chapter 4: Function Library
  649. *FILELIST.DOC: This file.
  650. *LICENSE.DOC: CEnvi Unregistered Shareware License Agreement
  651. *REGISTER.DOC: CEnvi registration form
  652. *INSTALL.CMM: Cmm source file for installing this shareware version
  653. * *.CMM, *.CMD, *.BAT, *.LIB: Many many sample programs using CEnvi.  See
  654.   CENVI.DOC for a complete list.
  655.  
  656. ----------------------------- REGISTRATION -------------------------------
  657. This is a shareware release.  Please register.  As a registered CEnvi user
  658. you will receive:
  659. *The latest version of CEnvi for all supported platforms (currently DOS,
  660.   OS/2, and Windows).
  661. *The CEnvi user's manual (almost 100 pages, including a description of the
  662.   Cmm programming language, a tutorial for those who have never programmed,
  663.   and descriptions and examples of the nearly 150 functions included in the
  664.   CEnvi library).
  665. *Free incremental electronic downloads for new versions of CEnvi for all
  666.   supported operating systems.
  667. *Unlimited support from Nombas and CEnvi/Cmm users through CompuServe
  668.   (72212,1622), internet (bsn@world.std.com), the cenvi-cmm e-mail mailing
  669.   list (cenvi-cmm@world.std.com), and the Nombas BBS (617-391-6595).
  670. *Access to the growing list of CEnvi utilities and libraries (some of which
  671.   are included in this unregistered shareware package, and others are
  672.   contributed by Nombas and CEnvi/Cmm users to the electronic locations
  673.   described above).
  674.  
  675. ------------------------- CENVI REGISTRATION FORM -------------------------
  676. Thank you for registering your shareware copy of CEnvi version 1.0.  Please
  677. fill out and mail in this form, along with payment.
  678.  
  679. Where did you get CEnvi? ______________________________________________
  680.  
  681. Name: _________________________________________________________________
  682.  
  683. Company: ______________________________ Position: _____________________
  684.  
  685. Address: ______________________________________________________________
  686.  
  687. _______________________________________________________________________
  688.  
  689. ______________________________________________________________________
  690.  
  691. Country: _________________________   (add ZIPcode if applicable)
  692.  
  693. Phone: ___________________________  EMail: ______________________________
  694.  
  695.           Diskette size: [  ] 3.5"   [  ] 5.25"
  696.  
  697. CEnvi Registered License ............ Quantity _____ x $38.00 = $ _________
  698. Additional CEnvi Registered licenses for your
  699. organization (does not include additional manuals
  700. or diskettes).  You must already be a registered
  701. user to purchase additional licenses.
  702.                     Additonal License Quantity _____ x $15.00 = $ _________
  703. Additional CEnvi Manuals.  You must already be a 
  704. registered user to purchase additional manuals.
  705.                    Additional Manuals Quantity _____ x $10.00 = $ _________
  706. Friend-of-Cmm Discount: enter $-5.00, and BBS
  707. location, if you have uploaded CEnvi Unregistered
  708. Shareware to a BBS where it wasn't already available.
  709.     BBS Location ____________________________________________   $-_________
  710. Shipping outside USA, Canada, or Mexico  $4.00 ................ $ _________
  711.                                                        Subtotal $ _________
  712. Massachusetts residents please add 5% sales tax ............... $ _________
  713.  
  714.                                                           Total $ _________
  715.  
  716. Include a check or money order for this total, in U.S. funds and drawn on a
  717. U.S. bank, payable to Nombas.  Mail with this form to:
  718.                Nombas
  719.                P.O. Box 875
  720.                Medford, MA  02155   USA
  721.  
  722. Nombas may also be contacted at:
  723.      BBS: (617)391-6595
  724.      Phone: (617)391-6595, (617)391-5289
  725.      Internet: bsn@world.std.com
  726.      CompuServe: 72212,1622
  727.  
  728.  
  729. Nombas welcomes all comments, good or bad, regarding CEnvi and Cmm.  Please
  730. use the back of this form to give us all your suggestions about CEnvi and
  731. Cmm.  This is version 1.0; Where should we go from here?
  732.